var http=require('http'),qs=require('querystring'),url=require('url');
http.createServer(function (req,res) {

    var params=url.parse(req.url,true);
    console.log('params:',params);
    var names=params.query.names.split(' ');
    var r={list:[]};
    names.forEach(function (name) {
        r.list.push({
            name:name
        });
    });
    console.log('r:',r);
    res.writeHead(200);
    res.end(JSON.stringify(r));

}).listen(3000, function () {
    console.log('Port 3000');
});